<template>
  <div class="">
    <!-- <dic-tags :crumbs="crumbsString" :tags="tagsArr" class="tagsbox"></dic-tags> -->
    <div class="m-content-box">
      <tab-btn
        :data="tabsData"
        :current-index="currentIndex"
        @tabsChange="tabsChangeHandle"
        class="tabs-box"
      ></tab-btn>
      <div class="contain">
        <transition name="fade" mode="out-in">
          <component v-bind:is="whichComp"></component>
        </transition>
      </div>
    </div>
    <fixed-nav :menu-list="menuList" @zydDialogShow="zydDialogShow"></fixed-nav>
    <add-New-dispute
      :dialogData="addDialogData"
      :isVisible="isVisible"
      @closeDialog="addDispute"
    ></add-New-dispute>
  </div>
</template>

<script>
import DicTags from "@/components/public/tags/DicTags";
import TabBtn from "@/components/customer/tabpage/TabBtn";
import MyCustomer from "@/views/customer/customer-child/MyCustomer";
import ControlCustomer from "@/views/customer/customer-child/ControlCustomer";
import CustomerQuery from "@/views/customer/customer-child/CustomerQuery";
import FixedNav from "@/views/customer/customer-child/FixedNav";
import AddNewDispute from "@/views/customer/components/addNewDispute";

export default {
  name: "CustomerInfoManage",
  data() {
    return {
      tabsData: [
        {
          name: "我的客户",
          icon: "el-icon-s-order",
        },
        {
          name: "我管控的客户",
          icon: "el-icon-s-order",
        },
        {
          name: "客户查询",
          icon: "el-icon-s-order",
        },
      ],
      crumbsString: "客户信息",
      tagsArr: [{ name: "产品明细", type: "" }],
      currentIndex: 0,
      whichComp: MyCustomer,
      // 我的客户表单样式
      formData: {
        // 客户编码
        custCode: "",
        // 营销责任地
        marketResponsibility: "",
        //客户编码-查询类型
        custCodeQueryType: [
          {
            value: "1",
            label: "精确查询",
          },
          {
            value: "2",
            label: "模糊查询",
          },
        ],
        // 客户编码-默认展示的值
        custCodeQueryTypeValue: "1",
        //直管类型
        straightType: "",
        // 行业类型
        industryType: "",
        // 是否合规
        isCompliance: "1",
        // 客户名称
        CUST_NAME: "",
        //客户名称-查询类型 accurate代表精确查询 fuzzy代表模糊查询
        custNameQueryType: [
          {
            value: "1",
            label: "请选择",
          },
          {
            value: "2",
            label: "未直管",
          },
          {
            value: "3",
            label: "区县直管",
          },
          {
            value: "4",
            label: "地市直管",
          },
          {
            value: "5",
            label: "省级直管",
          },
          {
            value: "6",
            label: "集团直管",
          },
        ],
        // 客户名称的险种的value
        custNameQueryTypeValue: "1",
        // 客户经理
        custManager: "",
        // 客户状态
        custStatus: [
          {
            value: "1",
            label: "有效",
          },
          {
            value: "2",
            label: "未生效-未送审",
          },
          {
            value: "3",
            label: "未生效-审核中",
          },
          {
            value: "4",
            label: "未生效-审核不通过",
          },
        ],
        // 客户状态选中的值
        custStatusValue: "1",
        // 客户名称与身份证是否一致
        isCardConsistent: "1",
      },

      // 表格数据
      tableData: [
        {
          CUST_ID: "1",
          PARTY_ID: "",
          OLD_PARTY_CODE: "",
          CUST_NAME: "重点用例测试",
          INDUSTRY_CD: "武警",
          COMMON_REGION_ID: "集团",
          CUST_MANAGER: "系统管理员",
          CREATE_DATE: "2021-02-27",
          CREATE_BY: "",
          CONTROL_TYPE: "未直管",
          STATUS_CD: "有效",
          IDENTITYTYPE: "JT20180808",
          PARTYNUMBER: "",
          IDEFFDATE: "2021-02-27",
          IDEXPDATE: "2022-02-27",
        },
        {
          CUST_ID: "2",
          PARTY_ID: "",
          OLD_PARTY_CODE: "",
          CUST_NAME: "重点用例测试",
          INDUSTRY_CD: "武警",
          COMMON_REGION_ID: "集团",
          CUST_MANAGER: "系统管理员",
          CREATE_DATE: "2021-02-27",
          CONTROL_TYPE: "未直管",
          CREATE_BY: "",
          STATUS_CD: "有效",
          IDENTITYTYPE: "JT20180808",
          PARTYNUMBER: "",
          IDEFFDATE: "2021-02-27",
          IDEXPDATE: "2022-02-27",
        },
      ],
      // tableData: [
      //   {
      //     // 客户编码
      //     custCode: "1000026961230000",
      //     // 客户名称
      //     custName: "重点用例测试",
      //     // 政企客户身份证
      //     custCard: "JT20180808",
      //     // 行业类型
      //     industryType: "武警",
      //     // 营销责任地
      //     marketResponsibility: "集团",
      //     // 直管类型
      //     custNameQueryTypeValue: "未直管",
      //     //  客户经理
      //     custManager: "系统管理员",
      //     //  创建时间
      //     creationTime: "2021-02-27",
      //     // 客户状态
      //     custStatus: "有效",
      //     //客户视图
      //     custView: "11",
      //     custApprovalHistory: "222",
      //   },
      //   {
      //     // 客户编码
      //     custCode: "1000026961230000",
      //     // 客户名称
      //     custName: "重点用例测试",
      //     // 政企客户身份证
      //     custCard: "JT20180808",
      //     // 行业类型
      //     industryType: "武警",
      //     // 营销责任地
      //     marketResponsibility: "集团",
      //     // 直管类型
      //     custNameQueryTypeValue: "未直管",
      //     //  客户经理
      //     custManager: "系统管理员",
      //     //  创建时间
      //     creationTime: "2021-02-27",
      //     // 客户状态
      //     custStatus: "有效",
      //     name: "11",
      //   },
      // ],

      //固定菜单的数组
      menuList: [
        {
          navText: "新建客户",
          icon: "add",
          type: "customer",
          path: "addCust",
          isDialog: false, //是否是弹窗
        },
        // {
        //   navText: "故障申请",
        //   icon: "gz",
        //   type: "customer",
        //   path: "customerGz",
        //   isDialog: false,
        // },
        {
          navText: "争议单",
          icon: "zy",
          type: "dispute",
          path: "customerZy",
          isDialog: true,
        },
        {
          navText: "结果反馈",
          icon: "result",
          type: "Result",
          path: "result",
          isDialog: false,
        },
      ],
      isVisible:false,//争议单弹窗显隐
      addDialogData: {
        applyStaffName: "",
        applyStaffPhone: "",
        custName: "",
        orgUscc: "",
        certType: "",
        certNum: "",
        problemType: [], //错误类型
        problemDesc: "",
      },
    };
  },
  components: {
    DicTags,
    TabBtn,
    MyCustomer,
    ControlCustomer,
    CustomerQuery,
    FixedNav,
    AddNewDispute,
  },
  created() {
  },
  mounted() {
   
  },
  methods: {
    //   点击按钮切换路由
    tabsChangeHandle(index) {
      this.currentIndex = index;
      switch (this.currentIndex) {
        case 0:
          this.whichComp = MyCustomer;
          break;
        case 1:
          this.whichComp = ControlCustomer;
          break;
        case 2:
          this.whichComp = CustomerQuery;
          break;
      }
    },
    //争议单弹窗显示
    zydDialogShow(){
      this.isVisible = true;
    },
    
    //争议单弹窗显隐
    addDispute() {
      this.isVisible = !this.isVisible;
    },
  },
};
</script>

<style lang="scss" scoped>
.tabs-box {
  border-bottom: 1px solid #e5e7ec;
}
.tagsbox {
  margin: 0.1rem 0.3rem 0 0.1rem;
}
.m-content-box {
  margin: 0.2rem 0.3rem;
  padding: 0.2rem 0.2rem;
  background-color: #fff;
  border-radius: 0.1rem;
}
.contain {
  padding: 0.3rem 0;
}
</style>
